﻿@{
    ViewBag.Title = "ResultPage";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

    <h2>ResultPage</h2>

    <p id="Vinnare">Vinnaren är <b>@Model.WinningPlayer.Name</b></p>
    <div id="info1">
    @foreach (var round in Model.PlayedGameRounds)
    {     
       <table>
        <tr>
            <td>@round.GameRoundNumber</td>
            @if (@round.WinningPlayer == null){
            <td><b>Lika</b></td>
            } else {<td><b>@round.WinningPlayer.Name</b></td>}
         @foreach(var choice in @round.PlayerChoices){
             var type = "";
            
             <td>@choice.Player.Name</td>
             if (choice.ChoiceMade == 0) { type = "Rock"; }
             else if (choice.ChoiceMade == 1) { type = "Scissor"; }
             else if (choice.ChoiceMade == 2) { type = "Paper"; }
             <td>: @type</td>
        
            }
            </tr>
           </table>
           }
        <form method="post" action="/Home/GoToStart">
            <input type="submit" value="Tillbaka till spel lobby" />
        </form>

        </div>